The Material object

This object gives access to Materials in Blender.

Warning: Most member variables assume values in some [Min, Max] interval. When trying to set them, the given parameter will be clamped to lie in that range: if val < Min, then val = Min, if val > Max, then val = Max.

Method Summary

float

getAdd()

Get the glow factor.

float

getAlpha()

Get the alpha (transparency) value.

float

getAmb()

Get the ambient color blend factor.

float

getEmit()

Get the emitting light intensity.

float

getFlareBoost()

Get the flare's extra strength.

int

getFlareSeed()

Get flare's offset in the seed table.

float

getFlareSize()

Get the ratio: flareSize / haloSize.

int

getHaloSeed()

Get the seed for random ring dimension and line location in halos.

float

getHaloSize()

Get the halo size.

int

getHardness()

Get the hardness of the specularity.

list of 3 floats

getMirCol()

Get the mirror color triplet.

int

getMode()

Get this Material's mode flags.

string

getName()

Get the name of this Material object.

int

getNFlares()

Get the number of halo subflares.

int

getNLines()

Get the number of star shaped lines on each halo.

int

getNRings()

Get the number of rings on each halo.

int

getNStars()

Get the number of points in the halo stars.

float

getRef()

Get the reflectivity value.

list of 3 floats

getRGBCol()

Get the rgb color triplet.

float

getSpec()

Get the specularity value.

list of 3 floats

getSpecCol()

Get the specular color triplet.

float

getSpecTransp()

Get the specular transparency.

float

getSubSize()

Get the dimension of subflare, dots and circles.

float

getZOffset()

Get the artificial offset for faces with this Material.

á

setAdd(add)

Set the glow factor.

á

setAlpha(alpha)

Set the alpha (transparency) value.

á

setAmb(amb)

Set the ambient color blend factor.

á

setEmit(emit)

Set the emitting light intensity.

á

setFlareBoost(flareboost)

Set the flare's extra strength.

á

setFlareSeed(flareseed)

Set flare's offset in the seed table.

á

setFlareSize(flaresize)

Set the ratio: flareSize / haloSize.

á

setHaloSeed(haloseed)

Set the seed for random ring dimension and line location in halos.

á

setHaloSize(halosize)

Set the halo size.

á

setHardness(hardness)

Set the hardness of the specularity.

á

setMirCol(rgb)

Set the mirror color triplet.

á

setMode(m, m2, m3, and_so_on, up_to_21)

Set this Material's mode flags.

á

setName(name)

Set the name of this Material object.

á

setNFlares(nflares)

Set the number of halo subflares.

á

setNLines(nlines)

Set the number of star shaped lines on each halo.

á

setNRings(nrings)

Set the number of rings on each halo.

á

setNStars(nstars)

Set the number of points in the halo stars.

á

setRef(ref)

Set the reflectivity value.

á

setRGBCol(rgb)

Set the rgb color triplet.

á

setSpec(spec)

Set the specularity value.

á

setSpecCol(rgb)

Set the specular color triplet.

á

setSpecTransp(spectransp)

Set the specular transparency.

á

setSubSize(subsize)

Set the dimension of subflare, dots and circles.

á

setZOffset(zoffset)

Set the artificial offset for faces with this Material.

Class Variable Summary

á

add - Glow factor - [0.0, 1.0].

á

alpha - Alpha (translucency) component of the Material - [0.0, 1.0].

á

amb - Ambient factor - [0.0, 1.0].

á

B - Blue component of rgbCol- [0.0, 1.0].

á

emit - Emitting light intensity - [0.0, 1.0].

á

flareBoost - Flare's extra strength - [0.1, 10.0].

á

flareSeed - Offset in the seed table - [0, 255].

á

flareSize - Factor the flare is larger than the halo - [0.1, 25.0].

á

G - Green component of rgbCol- [0.0, 1.0].

á

haloSeed - To use random values for ring dimension and line location - [0, 255].

á

haloSize - Dimension of the halo - [0.0, 100.0].

á

hard - Hardness of the specularity - [1, 255].

á

mirCol - Mirror color rgb triplet.

int

mode - Mode flags as an or'ed int value.

á

name - Material's name.

á

nFlares - Number of halo subflares - [1, 32].

á

nLines - Number of star shaped lines on each halo - [0, 250].

á

nRings - Number of halo rings - [0, 24].

á

nStars - Number of points on the halo stars - [3, 50].

á

R - Red component of rgbCol- [0.0, 1.0].

á

ref - Reflectivity - [0.0, 1.0].

á

rgbCol - Material's RGB color triplet.

á

spec - Specularity - [0.0, 2.0].

á

specCol - Specular color rgb triplet.

á

specTransp - Specular transparency - [0.0, 1.0].

á

subSize - Dimension of subflares, dots and circles - [0.1, 25.0].

á

zOffset - Artificial Z offset for faces - [0.0, 10.0].

Method Details

getAdd()

Get the glow factor.

Returns:

float

getAlpha()

Get the alpha (transparency) value.

Returns:

float

getAmb()

Get the ambient color blend factor.

Returns:

float

getEmit()

Get the emitting light intensity.

Returns:

float

getFlareBoost()

Get the flare's extra strength.

Returns:

float

getFlareSeed()

Get flare's offset in the seed table.

Returns:

int

getFlareSize()

Get the ratio: flareSize / haloSize.

Returns:

float

getHaloSeed()

Get the seed for random ring dimension and line location in halos.

Returns:

int

getHaloSize()

Get the halo size.

Returns:

float

getHardness()

Get the hardness of the specularity.

Returns:

int

getMirCol()

Get the mirror color triplet.

Returns:

[mirR, mirG, mirb]

áááááááááá (type=list of 3 floats)

getMode()

Get this Material's mode flags.

Returns:

OR'ed value. Use the Modes dictionary to check which flags are 'on'.

Example:

 import Blender
 from Blender import Material
 flags = mymat.getMode()
 if flags & Material.Modes['HALO']:
   print "This material is rendered as a halo"
 else:
   print "Not a halo"
                              

áááááááááá (type=int)

getName()

Get the name of this Material object.

Returns:

string

getNFlares()

Get the number of halo subflares.

Returns:

int

getNLines()

Get the number of star shaped lines on each halo.

Returns:

int

getNRings()

Get the number of rings on each halo.

Returns:

int

getNStars()

Get the number of points in the halo stars.

Returns:

int

getRef()

Get the reflectivity value.

Returns:

float

getRGBCol()

Get the rgb color triplet.

Returns:

[r, g, b]

áááááááááá (type=list of 3 floats)

getSpec()

Get the specularity value.

Returns:

float

getSpecCol()

Get the specular color triplet.

Returns:

[specR, specG, specB]

áááááááááá (type=list of 3 floats)

getSpecTransp()

Get the specular transparency.

Returns:

float

getSubSize()

Get the dimension of subflare, dots and circles.

Returns:

float

getZOffset()

Get the artificial offset for faces with this Material.

Returns:

float

setAdd(add)

Set the glow factor.

Parameters:

add - The new value in [0.0, 1.0].

áááááááááá (type=float)

setAlpha(alpha)

Set the alpha (transparency) value.

Parameters:

alpha - The new value in [0.0, 1.0].

áááááááááá (type=float)

setAmb(amb)

Set the ambient color blend factor.

Parameters:

amb - The new value in [0.0, 1.0].

áááááááááá (type=float)

setEmit(emit)

Set the emitting light intensity.

Parameters:

emit - The new value in [0.0, 1.0].

áááááááááá (type=float)

setFlareBoost(flareboost)

Set the flare's extra strength.

Parameters:

flareboost - The new value in [0.1, 10.0].

áááááááááá (type=float)

setFlareSeed(flareseed)

Set flare's offset in the seed table.

Parameters:

flareseed - The new value in [0, 255].

áááááááááá (type=int)

setFlareSize(flaresize)

Set the ratio: flareSize / haloSize.

Parameters:

flaresize - The new value in [0.1, 25.0].

áááááááááá (type=float)

setHaloSeed(haloseed)

Set the seed for random ring dimension and line location in halos.

Parameters:

haloseed - The new value in [0, 255].

áááááááááá (type=int)

setHaloSize(halosize)

Set the halo size.

Parameters:

halosize - The new value in [0.0, 100.0].

áááááááááá (type=float)

setHardness(hardness)

Set the hardness of the specularity.

Parameters:

hardness - The new value in [1, 255].

áááááááááá (type=int)

setMirCol(rgb=None)

Set the mirror color triplet. If rgb is None, set the color to black.

Parameters:

rgb - The rgb color values in [0.0, 1.0] as:

  • a list of three floats: setMirCol ([r, g, b]) or

  • three floats as separate parameters: setMirCol (r,g,b).

áááááááááá (type=three floats or a list of three floats)

setMode(m=None, m2=None, m3=None, and_so_on=None, up_to_21=None)

Set this Material's mode flags. Mode strings given are turned 'on'. Those not provided are turned 'off', so mat.setMode() -- without arguments -- turns off all mode flags for Material mat.

Parameters:

m - A mode flag. From 1 to 21 can be set at the same time.

áááááááááá (type=string)

setName(name)

Set the name of this Material object.

Parameters:

name - The new name.

áááááááááá (type=string)

setNFlares(nflares)

Set the number of halo subflares.

Parameters:

nflares - The new value in [1, 32].

áááááááááá (type=int)

setNLines(nlines)

Set the number of star shaped lines on each halo.

Parameters:

nlines - The new value in [0, 250].

áááááááááá (type=int)

setNRings(nrings)

Set the number of rings on each halo.

Parameters:

nrings - The new value in [0, 24].

áááááááááá (type=int)

setNStars(nstars)

Set the number of points in the halo stars.

Parameters:

nstars - The new value in [3, 50].

áááááááááá (type=int)

setRef(ref)

Set the reflectivity value.

Parameters:

ref - The new value in [0.0, 1.0].

áááááááááá (type=float)

setRGBCol(rgb=None)

Set the rgb color triplet. If rgb is None, set the color to black.

Parameters:

rgb - The rgb color values in [0.0, 1.0] as:

  • a list of three floats: setRGBCol ([r, g, b]) or

  • three floats as separate parameters: setRGBCol (r,g,b).

áááááááááá (type=three floats or a list of three floats)

setSpec(spec)

Set the specularity value.

Parameters:

spec - The new value in [0.0, 2.0].

áááááááááá (type=float)

setSpecCol(rgb=None)

Set the specular color triplet. If rgb is None, set the color to black.

Parameters:

rgb - The rgb color values in [0.0, 1.0] as:

  • a list of three floats: setSpecCol ([r, g, b]) or

  • three floats as separate parameters: setSpecCol (r,g,b).

áááááááááá (type=three floats or a list of three floats)

setSpecTransp(spectransp)

Set the specular transparency.

Parameters:

spectransp - The new value in [0.0, 1.0].

áááááááááá (type=float)

setSubSize(subsize)

Set the dimension of subflare, dots and circles.

Parameters:

subsize - The new value in [0.1, 25.0].

áááááááááá (type=float)

setZOffset(zoffset)

Set the artificial offset for faces with this Material.

Parameters:

zoffset - The new value in [0.0, 10.0].

áááááááááá (type=float)

Class Variable Details

add

Glow factor - [0.0, 1.0].

alpha

Alpha (translucency) component of the Material - [0.0, 1.0].

amb

Ambient factor - [0.0, 1.0].

B

Blue component of rgbCol - [0.0, 1.0].

emit

Emitting light intensity - [0.0, 1.0].

flareBoost

Flare's extra strength - [0.1, 10.0].

flareSeed

Offset in the seed table - [0, 255].

flareSize

Factor the flare is larger than the halo - [0.1, 25.0].

G

Green component of rgbCol - [0.0, 1.0].

haloSeed

To use random values for ring dimension and line location - [0, 255].

haloSize

Dimension of the halo - [0.0, 100.0].

hard

Hardness of the specularity - [1, 255].

mirCol

Mirror color rgb triplet.

mode

Mode flags as an or'ed int value. See the Modes dictionary keys and descriptions in Modes.

Type:

int

name

Material's name.

nFlares

Number of halo subflares - [1, 32].

nLines

Number of star shaped lines on each halo - [0, 250].

nRings

Number of halo rings - [0, 24].

nStars

Number of points on the halo stars - [3, 50].

R

Red component of rgbCol - [0.0, 1.0].

ref

Reflectivity - [0.0, 1.0].

rgbCol

Material's RGB color triplet.

spec

Specularity - [0.0, 2.0].

specCol

Specular color rgb triplet.

specTransp

Specular transparency - [0.0, 1.0].

subSize

Dimension of subflares, dots and circles - [0.1, 25.0].

zOffset

Artificial Z offset for faces - [0.0, 10.0].